package com.example.mapper;

import com.example.entity.GameInfo;
import com.example.entity.GymInfo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface GameInfoMapper {


    @Insert("insert into game_info(game_id,game_name,game_type,game_organizer,game_member,game_time,game_locationName,game_result)"+
            "values(#{gameId},#{gameName},#{gameType},#{gameOrganizer},#{gameMember},#{gameTime},#{gameLocationName},#{gameResult})")
    void insert(GameInfo gameInfo);

    @Delete("delete from game_info where id=#{id}")
    void deleteById(Integer id);

    @Update("update game_info set game_id= #{gameId},game_name= #{gameName},game_type= #{gameType},"+
             "game_organizer= #{gameOrganizer},game_member= #{gameMember},game_time= #{gameTime},game_locationName= #{gameLocationName},game_result= #{gameResult}  "+
        "where id = #{id}")
    void updateById(GameInfo gameInfo);


    List<GameInfo> selectAll(Integer gameId, String gameName, String gameType);


}
